<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>成都市12345话务接电系统</title>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link th:href="@{favicon.ico}" rel="shortcut icon"/>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.css}" rel="stylesheet"/>
    <link th:href="@{/css/skins.css}" rel="stylesheet"/>
    <link th:href="@{/common/css/hm-ui.css?v=4.6.2}" rel="stylesheet"/>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" th:classappend="${isMobile} ? 'canvas-menu'"
      style="overflow: hidden">
<div id="wrapper">

    <!--左侧导航开始-->
    <div class="row border-bottom">
        <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <a class="navbar-minimalize minimalize-styl-2" style="color:#FFF;" href="#" title="收起菜单">
                    <i class="fa fa-bars" style="color: #1a1a1a"></i>
                </a>
            </div>
            <div style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;
            display: -ms-flexbox;-ms-flex-pack: justify;-ms-flex-align: center;
            background-color: #ffff; height: 80px">
                <img th:src="@{/img/logo.png?t=100}"  style="margin-left: 50px;">
                <div style="font-size: initial;width: 250px;text-align:justify;
                text-justify: distribute-all-lines;"
                     th:classappend="${isMobile} ? 'hide-topic'">
                    <div>成都12345热线平台</div>
                </div>
                <input style="display: none" type="text" id="hdWorkNo" class="cltHd" th:value="${user.tklWNo}">
                <input style="display: none" type="text" id="hdSubTel" class="cltHd" th:value="${user.tklTNo}">
                <div th:if="${!#arrays.isEmpty(user.roles)}">
                    <input style="display: none" type="text" id="hdRole" class="cltHd"  th:value="${user.roles[0].roleId}">
                </div>
                <input style="display: none" type="text" id="hdEquFlag" class="cltHd" th:value="${user.flagInt}">
                <object class="ctiHideX" id="ctrl" classid="clsid:F618FE03-59E8-415B-8215-36C8643AB8B0"></object>
<!--                <div style="margin-top:1px;">-->
<!--                    <table cellspacing="0" cellpadding="0" border="0">-->
<!--                        <tbody>-->
<!--                        <tr>-->

<!--                            <td width="72" align="center" valign="middle"><a id="btn1a" href="javascript:void(0);"-->
<!--                                                                             onclick="clickImage('btn1',0)"><img th:src="@{/ctiHW/qianru03.jpg}" name="btn1"-->
<!--                                                                                                                 id="btn1" alt="签入签出" border="0"></a></td>-->
<!--                            <td width="72" align="center" valign="middle"><a id="btn2a" href="javascript:void(0);"-->
<!--                                                                             style="cursor:default"><img  th:src="@{/ctiHW/jieting02.jpg}" name="btn2" id="btn2"-->
<!--                                                                                                         alt="接听"   border="0"></a></td>-->
<!--                            <td width="72" align="center" valign="middle"><a id="btn9a" href="javascript:void(0);"-->
<!--                                                                             style="cursor:default"><img th:src="@{/ctiHW/baochi02.jpg}" name="btn9" id="btn9"-->
<!--                                                                                                         alt="保持" border="0"></a></td>-->
<!--                            <td width="72" align="center" valign="middle"><a id="btn3a" href="javascript:void(0);"-->
<!--                                                                             style="cursor:default"><img  th:src="@{/ctiHW/shixian02.jpg}" name="btn3" id="btn3"-->
<!--                                                                                                         alt="状态" border="0"></a></td>-->
<!--                            <td width="72" align="center" valign="middle"><a id="btn4a" href="javascript:void(0);"-->
<!--                                                                             style="cursor:default"><img th:src="@{/ctiHW/xiaoxiu02.jpg}" name="btn4" id="btn4"-->
<!--                                                                                                         alt="小休" border="0"></a></td>-->
<!--                            <td width="72" align="center" valign="middle"><a id="btn8a" href="javascript:void(0);"-->
<!--                                                                             style="cursor:default"><img th:src="@{/ctiHW/hujiao02.jpg}" name="btn8" id="btn8"-->
<!--                                                                                                         alt="呼叫" border="0"></a></td>-->
<!--                            <td width="72" align="center" valign="middle"><a id="btn6a" href="javascript:void(0);"-->
<!--                                                                             style="cursor:default"><img th:src="@{/ctiHW/sanfang02.jpg}" name="btn6" id="btn6"-->
<!--                                                                                                         alt="三方通话" border="0"></a></td>-->
<!--                            <td width="72" align="center" valign="middle"><a id="btn7a" href="javascript:void(0);"-->
<!--                                                                             style="cursor:default"><img th:src="@{/ctiHW/zhuanjie02.jpg}" name="btn7" id="btn7"-->
<!--                                                                                                         alt="转接" border="0"></a></td>-->
<!--                            <td width="72" align="center" valign="middle"><a id="btn5a" href="javascript:void(0);"-->
<!--                                                                             style="cursor:default"><img th:src="@{/ctiHW/guaduan02.jpg}" name="btn5" id="btn5"-->
<!--                                                                                                         alt="挂断" border="0"></a></td>-->

<!--                        </tr>-->
<!--                        </tbody>-->
<!--                    </table>-->
<!--                </div>-->
                <label id="ctiFreesum" class="stlMsgX"></label>
                <label id="ctiSigninsum" class="stlMsgX"></label>
                <label id="ctiListsum" class="stlMsgX"></label>
                <label id="ctiStatus" class="stlMsgY"></label>
                <label id="ctiLasttime" class="stlMsgY"></label>
                <label id="ctiCallphone" class="stlMsgY"></label>
<!--                排队：<span name="name" id="name"></span>-->
                <!-- 闹钟-->
<!--                <div>-->
<!--                    <div style="background-color: red;width: 10px;height: 10px;border-radius: 50%;float: right"></div>-->
<!--                    <img th:src="@{/img/inform.png}" style="cursor:pointer;float: right;">-->
<!--                </div>-->
                <ul class="nav navbar-top-links navbar-right welcome-message" style="margin-right: 10px">

                    <li class="dropdown user-menu">
                        <a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
                            <img th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}"
                                 th:onerror="this.src='img/profile.jpg'" class="user-image">
                        </a>
                        <ul class="dropdown-menu">
                            <li class="mt5">
                                <a th:href="@{/system/user/profile}" class="menuItem noactive">
                                    <i class="fa fa-user"></i> 个人中心</a>
                            </li>
                            <li>
                                <a onclick="resetPwd()">
                                    <i class="fa fa-key"></i> 修改密码</a>
                            </li>

                            <li class="divider"></li>
                            <li>
                                <a th:href="@{logout}">
                                    <i class="fa fa-sign-out"></i> 退出登录</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </div>

    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close">
            <i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse" style="width: auto;height: 96%;display: flex;flex-direction: column;justify-content: space-between;">
            <ul class="nav" id="side-menu">
                <li>
                    <a class="menuItem" th:href="@{/system/main}"><i class="fa fa-home"></i> <span
                            class="nav-label">首页</span> </a>
                </li>
                <li th:each="menu : ${menus}">
                    <a th:class="@{${!#strings.isEmpty(menu.url) && menu.url != '#'} ? ${menu.target}}"
                       th:href="@{${#strings.isEmpty(menu.url)} ? |#| : ${menu.url}}"
                       th:data-refresh="${menu.isRefresh == '0'}">
                        <i class="fa fa-bar-chart-o" th:class="${menu.icon}"></i>
                        <span class="nav-label" th:text="${menu.menuName}" th:title="${menu.remark}">一级菜单</span>
                        <span th:class="${#strings.isEmpty(menu.url) || menu.url == '#'} ? |fa arrow|"></span>
                    </a>
                    <ul class="nav nav-second-level collapse">
                        <li th:each="cmenu : ${menu.children}" >
                            <a th:if="${#lists.isEmpty(cmenu.children)}"
                               th:class="${#strings.isEmpty(cmenu.target)} ? |menuItem| : ${cmenu.target}"
                               th:utext="${cmenu.menuName}" th:href="@{${cmenu.url}}"
                               th:data-refresh="${cmenu.isRefresh == '0'}" th:title="${cmenu.remark}">二级菜单</a>
                            <a th:if="${not #lists.isEmpty(cmenu.children)}" href="#" >[[${cmenu.menuName}]]<span
                                    class="fa arrow"></span></a>
                            <ul th:if="${not #lists.isEmpty(cmenu.children)}"  class="nav nav-third-level">
                                <li th:each="emenu : ${cmenu.children}" >
                                    <a th:if="${#lists.isEmpty(emenu.children)}"
                                       th:class="${#strings.isEmpty(emenu.target)} ? |menuItem| : ${emenu.target}"
                                       th:text="${emenu.menuName}" th:href="@{${emenu.url}}"
                                       th:data-refresh="${emenu.isRefresh == '0'}" th:title="${emenu.remark}">三级菜单</a>
                                    <a th:if="${not #lists.isEmpty(emenu.children)}"  href="#">[[${emenu.menuName}]]<span
                                            class="fa arrow"></span></a>
                                    <ul th:if="${not #lists.isEmpty(emenu.children)}" class="nav nav-four-level">
                                        <li th:each="fmenu : ${emenu.children}" ><a
                                                th:if="${#lists.isEmpty(fmenu.children)}"
                                                th:class="${#strings.isEmpty(fmenu.target)} ? |menuItem| : ${fmenu.target}"
                                                th:text="${fmenu.menuName}" th:href="@{${fmenu.url}}"
                                                th:data-refresh="${fmenu.isRefresh == '0'}" th:title="${fmenu.remark}">四级菜单</a></li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ul>
            <!--<div class="navbar-header">
                <a class="navbar-minimalize minimalize-styl-2" style="color:#FFF;" href="#" title="收起菜单">
                    <i class="fa fa-bars" style="color: #1a1a1a"></i>
                </a>
            </div>-->
        </div>
    </nav>
    <!--左侧导航结束-->

    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row content-tabs">
            <button class="roll-nav roll-left tabLeft">
                <i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs menuTabs">
                <div class="page-tabs-content">
                    <a href="javascript:;" class="active menuTab" th:data-id="@{/system/main}">首页</a>
                </div>
            </nav>
            <button class="roll-nav roll-right tabRight">
                <i class="fa fa-forward"></i>
            </button>
            <a href="javascript:void(0);" class="roll-nav roll-right tabReload"><i class="fa fa-refresh"></i> 刷新</a>
        </div>

        <a id="ax_close_max" class="ax_close_max" href="#" title="关闭全屏"> <i class="fa fa-times-circle-o"></i> </a>

        <div class="row mainContent" id="content-main"
             th:style="${#bools.isFalse(ignoreFooter)} ? |height: calc(100% - 91px)|">
            <iframe class="NAP_iframe" name="iframe0" width="100%" height="100%" th:data-id="@{/system/main}" th:border="0" th:frameborder="no"
                    th:src="@{/system/main}" frameborder="0" seamless></iframe>
        </div>
    </div>
    <!--右侧部分结束-->
</div>
<!-- 全局js -->
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
<script th:src="@{/js/jquery.contextMenu.min.js}"></script>
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/common/js/hm-ui.js?v=4.6.2}"></script>
<script th:src="@{/common/js/common.js?v=4.6.2}"></script>
<script th:src="@{/common/index.js?v=20201208}"></script>
<script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
<script th:src="@{/js/zzHelper.js}"></script>

<script th:inline="javascript">
    window.history.forward(1);
    var ctx = [[@{/}]];
    var lockscreen = [[${session.lockscreen}]];
    var popIndex = 0;
    if (lockscreen) {
        window.top.location = ctx + "lockscreen";
    }

    function NewTelWinOpen(cid,tno,rid,calledid) {
        isOpenRcd = true;
        var title = '新增电话记录';
        var url = '/system/mTelRcd/telGetNew?idVal=-1&callid='+cid+'&calledid='+calledid+'&callin='+tno+'&tapeid='+rid+'&act=0';
        if(popIndex > 0) {
            layer.iframeSrc(popIndex, url);
        } else {
            popIndex = layer.open({
                type: 2,
                area: ['90%', '88%'],
                fix: false,
                maxmin: true,
                shade: 0,
                title: title,
                content: url,
                offset: '80px',
                //btn: ['确定', '关闭'],
                // 弹层外区域关闭
                shadeClose: false,
                yes: function(index, layero) {
                    var iframeWin = layero.find('iframe')[0];
                    iframeWin.contentWindow.submitHandler();
                },
                end: function () {
                    popIndex = 0;
                }
                // cancel: function(index) {
                //     NewTelWinClose();
                // }
            });
        }
    }


    function RecordFileGet() {
        try
        {
            var record = ctrl.RecordFilename;
            //alert(record);
            if(typeof(record)!="undefined")
                return record;
        }
        catch(e)
        {
            alert(e.message);
            return "";
        }
    }

    $(function(){
        setInterval(returnTotal,5000);
        function returnTotal(){
            $("span[name='name']").text(200);
            // $.ajax({
            //     type: "GET",
            //     url: "http://10.190.230.63:8080/test/findWaitTotal",
            //     dataType: "json",
            //     success: function(data){
            //         $("span[name='name']").each(function() {
            //             $(this).text(data);
            //         })
            //     }
            // });
        }
    })

    //切换签入，接听，保持。。。按钮
    $(document).ready(function(){
        var wNo = $("#hdWorkNo").val();
        var subTel = $("#hdSubTel").val();
        var roleId = $("#hdRole").val();
        var equFlag = $("#hdEquFlag").val();

        if(equFlag.length==0)
            equFlag="0";

        if(roleId!="903"){
            InitialCtiOcx(wNo,0,subTel,equFlag);//901外包坐席员
        }
        else{
            InitialCtiOcx(wNo,1,subTel,equFlag);//外包值班长
        }

    });
    // 皮肤缓存
    var skin = storage.get("skin");
    // history（表示去掉地址的#）否则地址以"#"形式展示
    var mode = "history";
    // 历史访问路径缓存
    var historyPath = storage.get("historyPath");
    // 是否页签与菜单联动
    var isLinkage = true;

    // 本地主题优先，未设置取系统配置
    if ($.common.isNotEmpty(skin)) {
        $("body").addClass(skin.split('|')[0]);
        $("body").addClass(skin.split('|')[1]);
    } else {
        $("body").addClass([[${sideTheme}]]);
        $("body").addClass([[${skinName}]]);
    }

    /* 用户管理-重置密码 */
    function resetPwd() {
        var url = ctx + 'system/user/profile/resetPwd';
        $.modal.open("重置密码", url, '770', '380');
    }

    /* 切换主题 */
    function switchSkin() {
        layer.open({
            type: 2,
            shadeClose: true,
            title: "切换主题",
            area: ["530px", "386px"],
            content: [ctx + "system/switchSkin", 'no']
        })
    }

    /* 切换菜单 */
    function toggleMenu() {
        $.modal.confirm("确认要切换成横向菜单吗？", function () {
            $.get(ctx + 'system/menuStyle/topnav', function (result) {
                window.location.reload();
            });
        })
    }


    /** 刷新时访问路径页签 */
    function applyPath(url) {
        $('a[href$="' + decodeURI(url) + '"]').click();
        if (!$('a[href$="' + url + '"]').hasClass("noactive")) {
            $('a[href$="' + url + '"]').parent("li").addClass("selected").parents("li").addClass("active").end().parents("ul").addClass("in");
        }
    }

    $(function () {
        var lockPath = storage.get('lockPath');
        if ($.common.equals("history", mode) && window.performance.navigation.type == 1) {
            var url = storage.get('publicPath');
            if ($.common.isNotEmpty(url)) {
                applyPath(url);
            }
        } else if ($.common.isNotEmpty(lockPath)) {
            applyPath(lockPath);
            storage.remove('lockPath');
        } else {
            var hash = location.hash;
            if ($.common.isNotEmpty(hash)) {
                var url = hash.substring(1, hash.length);
                applyPath(url);
            } else {
                if ($.common.equals("history", mode)) {
                    storage.set('publicPath', "");
                }
            }
        }

        /* 初始密码提示 */
        if ([[${isDefaultModifyPwd}]]) {
            layer.confirm("您的密码还是初始密码，请修改密码！", {
                icon: 0,
                title: "安全提示",
                btn: ['确认', '取消'],
                offset: ['30%']
            }, function (index) {
                resetPwd();
                layer.close(index);
            });
        }

        /* 过期密码提示 */
        if ([[${isPasswordExpired}]]) {
            layer.confirm("您的密码已过期，请尽快修改密码！", {
                icon: 0,
                title: "安全提示",
                btn: ['确认', '取消'],
                offset: ['30%']
            }, function (index) {
                resetPwd();
                layer.close(index);
            });
        }
        $("[data-toggle='tooltip']").tooltip();
    });

    function RecordFileGet() {
        try
        {
            var record = ctrl.RecordFilename;
            //alert(record);
            if(typeof(record)!="undefined")
                return record;
        }
        catch(e)
        {
            alert(e.message);
            return "";
        }
    }
</script>
</body>
<!--ocx事件处理begin -->
<!--OnAgentStatusChanged:座席状态改变事件， 当座席状态发生改变时触发。-->
<script language="javascript" for="ctrl" event="OnAgentStatusChanged()">
    updateAgentStatus();//显示当前状态，显示“示忙”或“示闲”图标

    // added by fj @ 2014/04/07 20:05
    if(ctrl.AgentStatus == 5)
    {
        var callInfo = ctrl.ActiveCallInfo;

        if(callInfo != null && callInfo.CallDirection == 1)
        {
            NewTelWinOpen(callInfo.CallId,callInfo.CallerNum,-1,callInfo.CalledNum);
        }
    }
    // end add
    //updateLoginStatus();
</script>

<!--呼叫状态改变事件， 当呼叫状态发生改变时触发。-->
<script language="javascript" for="ctrl" event="OnCallStateChanged()">
    //alert("呼叫状态发生改变");
    var confstate = ctrl.ConferenceState;//0 没有进行三方通话操作;1 已经初始化三方通话;2 第三方已经接通，等到确认;3 正在进行三方通话;
    if(confstate == 3)
        cti_sanfangc();

    var transstate = ctrl.TransferState;//0 没有进行转接操作;1	 已经初始化转接;2	  第三方已经接通，等到确认.
    if(transstate == 2)
        cti_zhuanjiec();

    updatePhoneNumber();//显示去电或来电的号码
</script>

<!--请求应答事件，当有电话呼入时触发。-->
<script language="javascript" for="ctrl" event="OnAnswerRequest()">
    //测试：在"欢迎拨打。。。转接中请稍候。。。语音报了工号”后开始出现拨号音后才触发
    //alert("主叫号码："+ ctrl.ActiveCallInfo.CallerNum+";被叫号码："+ctrl.ActiveCallInfo.CalledNum+";callid："+ctrl.ActiveCallInfo.CallId+";呼叫方向："+ctrl.ActiveCallInfo.CallDirection);
    //NewTelWinOpen(ctrl.ActiveCallInfo.CallId,ctrl.ActiveCallInfo.CallerNum,"-1");//NewTelWinOpen(cid,tno,rid)
    //（ok）主叫号码：打进电话的号码；被叫号码显示分机号：60003
</script>

<!--呼叫释放事件，当活动呼叫或保持的呼叫被挂断时触发。-->
<script language="javascript" for="ctrl" event="OnCallReleased()">

</script>

<!--强制示闲事件，当座席被班长座席强制示闲时触发。-->
<script language="javascript" for="ctrl" event="OnForceReady()">
    //alert(" ");//
</script>

<!--强制示忙事件，当座席被班长座席强制示忙时触发。-->
<script language="javascript" for="ctrl" event="OnForceNotReady()">
    //alert(" ");//
</script>

<!--强制签出事件，当座席被班长座席强制签出时触发。-->
<script language="javascript" for="ctrl" event="OnForceLogout()">
    //alert(" ");//
</script>

<!-- 录音事件 -->
<script language="javascript" for="ctrl" event="OnRecordStart (fileName)">
    // 	alert(" ");//
</script>
<!--ocx事件处理end-->

</html>
